package com.greateffect.littlebud.lib.utils;

import android.view.View;

import java.util.Calendar;

/**
 * Created by ZengCS on 2019/8/22.
 * E-mail:zcs@sxw.cn
 * Add:成都市天府软件园E3-3F
 */
public class FastDoubleClickExclude {
    public static boolean isFastDoubleClick(View v) {
        Object tag = v.getTag(v.getId());
        long beforeTimeMillis = tag != null ? (long) tag : 0;
        long timeInMillis = Calendar.getInstance().getTimeInMillis();
        v.setTag(v.getId(), timeInMillis);
        return timeInMillis - beforeTimeMillis < 1_000;
    }
}
